<?php
namespace juven {
    \defined( '_JEXEC' ) or die( 'Restricted access' );
    
    //******************************************************************************
    // SECTION - GENERAL
    \define('DS', \DIRECTORY_SEPARATOR);
    
    //******************************************************************************
    // SECTION - Framework GENERAL
    
        // Physical Paths
    $this->protectedFolderPath          = $this->entryPoint.         "protected".  \DS;
    $this->publicFolderPath             = $this->entryPoint.         "public".     \DS;
    $this->libsFolderPath               = $this->protectedFolderPath."libs".       \DS;
    $this->eventsHandlersFolderPath     = $this->protectedFolderPath."events_handlers".\DS;
    $this->controllersFolderPath        = $this->protectedFolderPath."controllers".\DS;
    $this->modelsFolderPath             = $this->protectedFolderPath."models".     \DS;
    $this->viewsFolderPath              = $this->protectedFolderPath."views".      \DS;
    $this->formsFolderPath              = $this->protectedFolderPath."forms".      \DS;
    $this->cssFolderPath                = $this->publicFolderPath   ."css".        \DS;
    $this->jsFolderPath                 = $this->publicFolderPath   ."js".         \DS;
    $this->imagesFolderPath             = $this->publicFolderPath   ."imgs".       \DS;
    
    $this->inDebugMode                  = \TRUE;
    $this->inProductionMode             = !$this->inDebugMode;
    $this->systemAdminEmailAddress      = "zeageorge@gmail.com";
    $this->siteRootUrl                  = "http://localhost/juven/";
    $this->siteTitle                    = "Juven";
    
    $this->db                                   = new libs\DynamicContainer();
    $this->db->connectionData                   = new libs\DynamicContainer();
    $this->db->connectionData->type             = "mysql";
    $this->db->connectionData->host             = "localhost";
    $this->db->connectionData->port             = "3306";
    $this->db->connectionData->name             = "juv_sys_v03";
    $this->db->connectionData->username         = "juv_system";
    $this->db->connectionData->user_password    = "1234";
    $this->db->connectionData->table_prefix     = "tbl_";
    
    $this->db->tables                           = new libs\DynamicContainer();
    $this->db->tables->databases                = "databases";
    $this->db->tables->groups                   = "groups";
    $this->db->tables->http_requests            = "http_requests";
    $this->db->tables->http_requests_groups     = "http_requests_groups";
    $this->db->tables->menus                    = "menus";
    $this->db->tables->menus_data               = "menus_data";
    $this->db->tables->menus_groups             = "menus_groups";
    $this->db->tables->sessions                 = "sessions";
    $this->db->tables->users                    = "users";
    $this->db->tables->users_groups             = "users_groups";
    
//    $this->db->defaultUser_groupID      = 1;
//    $this->db->public_group_id          = 1024;
    $this->db->guest_user_id            = 1024;
    $this->db->userExtraData_TablePrefix="user_";
    
    $this->http_request = new libs\DynamicContainer();
    $this->http_request->fieldName                           = "url"; // if you change this you must also change it in .htaccess
    $this->http_request->defaultControllerName               = "index";
    $this->http_request->defaultActionName                   = "index"; // this is for all controllers
    $this->http_request->defaultPageNotFound404ControllerName= "PAGE_NOT_FOUND_404";    // this must exists under controllers' folder
    $this->http_request->defaultPermissionDenied             = "PERMISSION_DENIED_403"; // this must exists under controllers' folder
    $this->http_request->controllerName_minLength    = 1;
    $this->http_request->controllerName_maxLength    = 32;
    $this->http_request->controllerName_allowedChars = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
                                                            'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
                                                            '0','1','2','3','4','5','6','7','8','9','_',);
    $this->http_request->actionName_maxLength        = 32;
    $this->http_request->actionName_allowedChars     = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
                                                            'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
                                                            '0','1','2','3','4','5','6','7','8','9','_',);
    $this->http_request->params_maxLength            = 128;
    $this->http_request->maximumNumberOfParameters   = 5;
    $this->http_request->params_allowedChars         = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
                                                            'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
                                                            '0','1','2','3','4','5','6','7','8','9','_','=');

    $this->Login = new libs\DynamicContainer();
    $this->Login->remember_user = \TRUE;
    $this->Login->username_minLength        = 4;
    $this->Login->username_maxLength        = 32;
    $this->Login->username_allowedChars     = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s',
                                                    't','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L',
                                                    'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9','_','-',);
    $this->Login->password_minLength        = 3;
    $this->Login->password_maxLength        = 32;
    $this->Login->password_allowedChars     = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s',
                                                    't','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L',
                                                    'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9','_','-',);
    $this->Login->emailAddress_minLength    = 10;
    $this->Login->emailAddress_maxLength    = 32;
    $this->Login->emailAddress_allowedChars = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s',
                                                    't','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L',
                                                    'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9','_','-','@','.',);
    
    //******************************************************************************
    // SECTION - PHP RUNTIME GENERAL
    // 
    if ($this->inProductionMode){
        \ini_set('display_startup_errors',0);
        \ini_set('display_errors', 0);
    } else {
        \ini_set('display_startup_errors',1);
        \ini_set('display_errors', 1);
    }
    \error_reporting(-1);
    \date_default_timezone_set('Europe/Athens');
    \setlocale(\LC_ALL,'es_ES.UTF-8');
    
}
?>
